//
// C++ Interface: key_bindings
//
// Description: 
//
//
// Author: Juan Linietsky <reduzio@gmail.com>, (C) 2006
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef KEY_BINDINGS_H
#define KEY_BINDINGS_H

/**
	@author Juan Linietsky <reduzio@gmail.com>
*/


enum KeyBindList {


	KB_CURSOR_MOVE_UP,
	KB_CURSOR_MOVE_DOWN,
	KB_CURSOR_MOVE_LEFT,
	KB_CURSOR_MOVE_RIGHT,
 	KB_CURSOR_MOVE_UP_1_ROW,
	KB_CURSOR_MOVE_DOWN_1_ROW,
	KB_CURSOR_MOVE_TRACK_LEFT,
	KB_CURSOR_MOVE_TRACK_RIGHT,
	KB_CURSOR_PAGE_UP,
	KB_CURSOR_PAGE_DOWN,
	KB_CURSOR_HOME,
	KB_CURSOR_END,
	KB_CURSOR_INSERT,
	KB_CURSOR_DELETE,
	KB_CURSOR_TAB,
	KB_CURSOR_BACKTAB,
	KB_CURSOR_FIELD_CLEAR,
	KB_CURSOR_WRITE_MASK,
	KB_PATTERN_CURSOR_NOTE_OFF,
	KB_PATTERN_CURSOR_PLAY_FIELD,
	KB_PATTERN_CURSOR_PLAY_ROW,
	KB_PATTERN_PAN_WINDOW_UP,
	KB_PATTERN_PAN_WINDOW_DOWN,
	KB_PATTERN_MARK_BLOCK_BEGIN,
	KB_PATTERN_MARK_BLOCK_END,
	KB_PATTERN_MARK_COLUMN_ALL,
	KB_PATTERN_BLOCK_COPY,
	KB_PATTERN_BLOCK_PASTE_INSERT,
	KB_PATTERN_BLOCK_PASTE_OVERWRITE,
	KB_PATTERN_BLOCK_PASTE_MIX,	
	KB_PATTERN_BLOCK_UNMARK,
	KB_PATTERN_BLOCK_CUT,
	KB_PATTERN_BLOCK_SET_CURRENT_VOLUME,
	KB_PATTERN_BLOCK_WIPE_STRAY_VOLUMES,
	KB_PATTERN_BLOCK_RAMP_VALUES,
	KB_PATTERN_BLOCK_AMPLIFY_VOLUMES,
	KB_PATTERN_BLOCK_DOUBLE_BLOCK_LENGTH,
	KB_PATTERN_BLOCK_HALVE_BLOCK_LENGTH,
	KB_PATTERN_FIELD_TOGGLE_MASK,
	KB_PATTERN_FIELD_COPY_CURRENT,
	KB_PATTERN_FIELD_WRITE_CURRENT,
	KB_PATTERN_RAISE_NOTES,
	KB_PATTERN_LOWER_NOTES,
	KB_PATTERN_RAISE_12_NOTES,
	KB_PATTERN_LOWER_12_NOTES,
	KB_PATTERN_NEXT,
	KB_PATTERN_PREV,
	KB_PATTERN_NEXT_ORDER,
	KB_PATTERN_PREV_ORDER,
	KB_PATTERN_MUTE_TOGGLE_CHANNEL,
	KB_PATTERN_SOLO_TOGGLE_CHANNEL,
	KB_PATTERN_CURSOR_SPACING_0,
	KB_PATTERN_CURSOR_SPACING_1,
	KB_PATTERN_CURSOR_SPACING_2,
	KB_PATTERN_CURSOR_SPACING_3,
	KB_PATTERN_CURSOR_SPACING_4,
	KB_PATTERN_CURSOR_SPACING_5,
	KB_PATTERN_CURSOR_SPACING_6,
	KB_PATTERN_CURSOR_SPACING_7,
	KB_PATTERN_CURSOR_SPACING_8,
	KB_PATTERN_CURSOR_SPACING_9,
	KB_PATTERN_SCREEN_OPTIONS,
	KB_PATTERN_SCREEN_SONG_FOLLOW,
	KB_ORDERLIST_INSERT_SEPARATOR,

	
	KB_PIANO_C0,
	KB_PIANO_Cs0,
	KB_PIANO_D0,
	KB_PIANO_Ds0,
	KB_PIANO_E0,
	KB_PIANO_F0,
	KB_PIANO_Fs0,
	KB_PIANO_G0,
	KB_PIANO_Gs0,
	KB_PIANO_A0,
	KB_PIANO_As0,
	KB_PIANO_B0,
	KB_PIANO_C1,
	KB_PIANO_Cs1,
	KB_PIANO_D1,
	KB_PIANO_Ds1,
	KB_PIANO_E1,
	KB_PIANO_F1,
	KB_PIANO_Fs1,
	KB_PIANO_G1,
	KB_PIANO_Gs1,
	KB_PIANO_A1,
	KB_PIANO_As1,
	KB_PIANO_B1,
	KB_PIANO_C2,
	KB_PIANO_Cs2,
	KB_PIANO_D2,
	KB_PIANO_Ds2,
	KB_PIANO_E2,
	KB_PLAYER_PLAY_SONG,
	KB_PLAYER_STOP_SONG,
	KB_PLAYER_FF_SONG,
	KB_PLAYER_RW_SONG,
	KB_PLAYER_PLAY_PATTERN,
	KB_PLAYER_PLAY_CURSOR,
	KB_PLAYER_PLAY_ORDER,
	KB_OCTAVE_RAISE,
	KB_OCTAVE_LOWER,
	KB_GOTO_PATTERN_SCREEN,	
	KB_GOTO_PATTERN_SCREEN_ORDERLIST,	
	KB_FILE_OPEN,
	KB_FILE_SAVE,
	KB_FILE_SAVE_AS,
	KB_DISPLAY_TOGGLE_FULLSCREEN,
	KB_UNDO,
	KB_REDO,
	KB_QUIT,
	KB_MAX,

};

enum {

	KB_PIANO_MIN=KB_PIANO_C0,
	KB_PIANO_MAX=KB_PIANO_E2
};

#define NO_BIND 0xFFFFFFFF
class KeyBind {
	struct KeyBindItem {

		
		unsigned int bind_code;
		const char * description;
		
		KeyBindItem() { bind_code=NO_BIND; description="";} //disabled
	};

	KeyBindItem key_binds[KB_MAX];

	static KeyBind *singleton;
	
public:

	static unsigned int get(KeyBindList p_bind);
	static void set(KeyBindList p_bind,unsigned int p_bind_code);
	static KeyBindList get_bind(unsigned int p_bind_code);
	static int get_keybind_count();
	static unsigned int get_keybind_code(int p_index);
	static void set_keybind_code(int p_index,unsigned int p_code);
	static const char* get_keybind_description(int p_index);
	
	KeyBind();
	~KeyBind();

};

#endif
